package com.wanshi.member.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wanshi.member.entity.Goods;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wanshi.member.req.GoodsREQ;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 商品信息表 Mapper 接口
 * </p>
 *
 * @author 顽石教育-www.wanshi.com
 * @since 2021-05-08
 */
public interface GoodsMapper extends BaseMapper<Goods> {
    IPage<Goods> findByCondPage(IPage<Goods> p,@Param("req") GoodsREQ req);

    @Select("SELECT *,(SELECT NAME FROM tb_supplier WHERE id = supplier_id) supplier_name FROM tb_goods WHERE id = #{id}")
    Goods findById(int id);
}
